-
-
Notifications
You must be signed in to change notification settings - Fork 44
Use node label instead of identifier for display text of footnote references #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…erences By using the `footnoteReference` label property instead of its identifier (which must be shared between the footnoteReference and the footnoteDefinition for the links between them to work), remark plugins can easily change the display text for footnote references.
wooorm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea! Appreciated!
I’m suggesting a simpler mechanism that would still allow the label to be used, but default to the identifier if label isn’t there.
Normally, from remark-parse, an identifier is for example foo, whereas the label could in that case be Foo. In other words, typically the casing is different. Could you add a test for this?
|
Thanks for your feedback @wooorm! I've made the changes you requested to make the implementation a bit simpler. |
|
Nice! Thanks Patrick! |
As of syntax-tree/mdast-util-to-hast#31, the footnote label is used for footnotes instead of its identifier. This change brings back numbered footnotes correctly.
By using the
footnoteReferencelabel property instead of its identifier (which must be shared between the footnoteReference and the footnoteDefinition for the links between them to work), remark plugins can easily change the display text for footnote references.Edit: Note that because of the way that remark computes
identifiervslabeloffootnoteReference, this causes a minor change to the default label text of rendered footnote references (but only for separately defined references and definitions, not for inline footnotes). The label text is now what is actually used as footnote ID in the source, not the identifier-ized version.